from django.shortcuts import render_to_response
from django.template import RequestContext

import os, sys  
  
sys.path.insert(0, "C:\Documents and Settings\wendy_admin\src\eclipse_workspace\djangodb\main")  
if not os.environ.has_key("DJANGO_SETTINGS_MODULE"):
    os.environ["DJANGO_SETTINGS_MODULE"]="formstates_wjContact.settings"
    

import datetime

from django import newforms as forms
from django.shortcuts import render_to_response, get_object_or_404
from django.http import HttpResponseRedirect
from django.core.urlresolvers import reverse
from django.template import RequestContext
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import redirect_to_login
from django.core.paginator import ObjectPaginator


from formstates_wjContact.constants import MSG_CODES, DEFAULT_LISTSIZE

from formstates_wjContact.contacts.models import Contact, Recipient, Volunteer
#from formstates_wjContact.contacts.views.forms import ContactForm, RecipientForm, VolunteerForm



from formstates_wjContact.sales.models import Sale
#from formstates_wjContact.computers.models import Computer


##============================================================================##
## Some general-utility views - logout, and underConstruction 
## ===========================================================================##    
def logout(request, next_page=None, template_name='accounts/logged_out.html'):
    from django.contrib.auth.views import logout
    return logout(request, next_page=None, template_name=template_name)  
    
def underConstruction(request):
    """ This view just throws out the 'under construction' page. """
    return render_to_response('under_construction.html', 
                              context_instance=RequestContext(request))

##============================================================================##
## Probably deprecated methods - here only until their replacements are fully 
## finished
## ===========================================================================##


##============================================================================##
## Methods for cbv-users
## ===========================================================================##
def viewProfile(request):
    """
    View a cbv-staff-user's personalised settings. At the moment this view does 
    nothing much, as users have no personalised settings, but once they do, 
    they can view and change them here :)  Personalised settings are things 
    like which style sheet to use and how many results to show on the 
    search page.
    """
    return render_to_response('accounts/profile.html', 
        context_instance=RequestContext(request))